/*
 * @Author       : 郭庆红
 * @Date         : 2025-03-08 14:55:21
 * @LastEditors  : 郭庆红
 * @LastEditTime : 2025-03-14 09:39:32
 * @FilePath     : e:\project\zhlx-autoform-ui\src\api\workflow\index.ts
 * @Description  : 
 * Copyright 2025 OBKoro1, All Rights Reserved. 
 * 2025-03-08 14:55:21
 */
import service from "@/utils/request";

/**
 * 获取流程表单列表
 * @param data - 包含表单相关信息的对象
 * @param data.formId - 表单 ID
 * @param data.bookId - 书籍 ID
 * @param data.errorList - 表格列表
 * @param data.version - 版本号（可选）
 * @param data.recordId - 记录 ID（可选）
 * @param data.subFormId - 子表单 ID（可选）
 * @returns 返回服务调用的结果
 */
export function flowSelectComponent(data: {
  exampleTitle?: string, 
  businessCode?: string,  
  draftUserId?: any[],
  draftDeptId?: number,
  createTime?: string, 
  exampleStatus?: string, 
  acceptTime?: string, 
  current: number,
  size: number
}) {
  const current = data.current;
  const size = data.size;
  delete data.current
  delete data.size
  return service({
    url: `/workflow/4from/flowSelectComponent?current=${current}&size=${size}`,
    method: "post",
    data,
		headers: {
      'Content-Type': "application/json;charset=UTF-8"
    },
  })
}

/**
 * 获取模板流程列表
 * @param businessCode 业务ID
 * @param keywords
 * @param isIncludeSub 是否包含子流程
 * @param businessTypeCode  业务类型 发起流程需要
 * @returns 返回请求结果
 */
export function getTemplateFlowList({ businessCode, keywords, isIncludeSub, businessTypeCode }: FlowListQuery) {
  return service({
    url: '/workflow/workflow/flowTemplate/templateVisiable',
    method: 'get',
    params: {
      businessCode,
      keywords,
      isIncludeSub,
      businessTypeCode
    },
  });
}